{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Geo / radar coordinates conversion using MintPy functions ###\n",
    "You can use the \"coordinate\" object in MintPy to conver the coordinates between radar and geo precisely, i.e. y/x --> lat/lon, or lat/lon --> y/x. Here y and x are the row and column number of the pixel(s) of interest.\n",
    "\n",
    "For file in geo coordinates, the conversion is simply to tranform the pixel size from \"1\" in pixel number to Y/X_STEP in degree. For file in radar coordinates, \"coordinate\" object uses the lookup table file generated by InSAR processor to search the corresponding area and uses the mean value/coordinate of the area.\n",
    "\n",
    "Below shows the usage with an example data pre-processed by ISCE-2.2. You can turn on the \"debug_mode\" to see how the function searches the corresponding Y/X value given lat/lon."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input         radar coordinate in (y, x): (1744, 1264)\n",
      "corresponding   geo coordinate in (lat, lon): (-0.8658891916275024, -91.56937408447266)\n",
      "input           geo coordinate in (lat, lon): (-0.8658891916275024, -91.56937408447266)\n",
      "corresponding radar coordinate in (y, x): (1744, 1264)\n"
     ]
    }
   ],
   "source": [
    "# Usage example\n",
    "%matplotlib inline\n",
    "import os\n",
    "from mintpy.utils import readfile, utils as ut\n",
    "\n",
    "# lookup table file\n",
    "proj_dir = os.path.expanduser('~/insarlab/Galapagos/GalapagosSenDT128/mintpy')\n",
    "geom_file = os.path.join(proj_dir, 'inputs/geometryRadar.h5')   # for Gamma/ROI_PAC, it's geometryGeo.h5\n",
    "vel_file  = os.path.join(proj_dir, 'velocity.h5')               # file of interest, it's can be in radar or geo coordinate\n",
    "#vel_file  = os.path.join(proj_dir, 'geo/geo_velocity.h5')      # file of interest, it's can be in radar or geo coordinate\n",
    "\n",
    "# initiate coordinate object\n",
    "atr = readfile.read_attribute(vel_file)\n",
    "coord = ut.coordinate(atr, lookup_file=geom_file)\n",
    "coord.open()\n",
    "\n",
    "# row/col number --> lat/lon in degree (radar to geo)\n",
    "y1, x1 = 1744, 1264\n",
    "lat1, lon1 = coord.radar2geo(y1, x1)[0:2]\n",
    "print('input         radar coordinate in (y, x): ({}, {})'.format(y1, x1))\n",
    "print('corresponding   geo coordinate in (lat, lon): ({}, {})'.format(lat1, lon1))\n",
    "\n",
    "# lat/lon in degree --> row/col number (geo to radar)\n",
    "lat2, lon2 = lat1, lon1\n",
    "y2, x2 = coord.geo2radar(lat2, lon2)[0:2]\n",
    "print('input           geo coordinate in (lat, lon): ({}, {})'.format(lat2, lon2))\n",
    "print('corresponding radar coordinate in (y, x): ({}, {})'.format(y2, x2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Debug mode is ON.\n",
      "Show the row/col number searching result.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtAAAAEXCAYAAACEUnMNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XucXVV9///X24RLQSm3SCGEcGnwV+IFJRJaxVKlChQF+SIE/SkoNcZCK9+vtoLWglj7tSpSLRWMBQGVmyAIFYpAFfRXbiFyi4AEjDIkDbdwRzTw/v2x18E9hzOXM3Nm5syZ9/PxmEf2WXvtvdc6yZ7zyTqfvZZsExERERERw/OSiW5ARERERMRkkgA6IiIiIqINCaAjIiIiItqQADoiIiIiog0JoCMiIiIi2pAAOiIiIiKiDQmgJ5CkN0i6W9KTkvaXtIWkayQ9IemEDpx/d0l3daKtI7j2Ckl7lu1PSPr3cbruuF0rppZevl/L9S3pD8v2KZI+NU7XHbdrRUR0ijIP9MhJWgFsATwH/Bb4b2CR7fuGefxVwMW2v1xefwp4LfC/PIF/MZLmUvXl9bZ/Xiu/Crj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On8Z4C0t6hs4YoBznQac1k4DKV8NTwFToZ9ToY8wdfrZylTpe/rZW6ZKPyOiQ1TFuxERERERMRxZyjsiIiIiog1dG0BL2kvSXWVJ8KOHPqK7SVoh6TZJN0taUsraXg6920g6TdIDkm6vlfXcMu8D9PM4SfeXv9ObJe1T23dM6eddkt5WK++pf9cNvdav3K+5X0t5T/27jogOst11P8A04B5ge2Bd4BZgp4lu1yj7tALYvKns88DRZfto4J/L9j7AZVS557sB1090+wfp15uA1wG3j7RfwKbAveXPTcr2JhPdt2H08zjgYy3q7lT+za4HbFf+LU/rxX/Xpb8916/cr7lfe/HfdX7yk5/O/XTrCPSuwHLb99r+DXAO1RLhvabd5dC7ju1rgObZVHpumfcB+jmQ/YBzbD9r+xdUM9LsSu/+u+7VfjXL/Zr7tRf/XUfECHRrAN2Ly34b+IGkm1St3AbtL4c+WUylZd6PLF9vn9b46pve7OdgerFfuV97899x7teI6IhuDaCHvez3JPIG268D9gaOkPSmQer2Yv+hA8u8d5mTgR2AnYFVwAmlvNf6OZRe7Ffu1977d5z7NSI6plsD6IGWA5+0bK8sfz4AXEj19eDqxle9Gt5y6JNFu/2alP21vdr2c7afB75O9XcKPdbPYei5fuV+BXrs33Hu14jopG4NoG8E5kjaTtK6wAKqJcInJUkbSnpZY5tqGfPbaX859MliSizz3pTn+k6qv1Oo+rlA0nqStgPmADfQY/+ua3qqX7lfc7/S2/drRHTAcJbyHne210o6kuqX8jTgNNvLJrhZo7EFcKEkqN7zs2z/p6QbaWM59G4k6WxgD2BzSX3AsfTgMu8D9HMPSTtTfa27AvgQgO1lks4DfgasBY6w/Vw5Ty/9uwZyv5L7NfdrREw5WYkwIiIiIqIN3ZrCERERERHRlRJAR0RERES0IQF0REREREQbEkBHRERERLQhAXRERERERBsSQEdEREREtCEBdEREREREGxJAR0RERES04f8HjBrOva5ZynQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 864x360 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(1744, 1264)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Plot to show how it works\n",
    "coord.geo2radar(lat2, lon2, debug_mode=True)[0:2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
